
package com.jf.cloud.api.product.feign;

import com.jf.cloud.common.feign.FeignInsideAuthConfig;
import com.jf.cloud.common.response.ServerResponseEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author zz
 * @date 2020/11/12
 */
@FeignClient(value = "jfcloud-product", contextId = "spuComm")
public interface SpuCommFeignClient {

    /**
     * 获取时间范围内的销量排序，放入redis并返回当前分页的商品信息
     *
     *
     * @param key
     * @param shopId 店铺id
     * @param time 时间范围内
     * @param expireTime
     * @param esRenovationSpuSort
     * @param primaryCategoryId
     * @return
     */
    @GetMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX + "/insider/product/getCommNumRankSpuIdsByShopIdAndTime")
    ServerResponseEntity<List<Long>> getCommNumRankSpuIdsByShopIdAndTime(@RequestParam("key") String key, @RequestParam("shopId") Long shopId,
                                                                         @RequestParam("time") Integer time, @RequestParam("expireTime") Integer expireTime,
                                                                         @RequestParam("esRenovationSpuSort") Integer esRenovationSpuSort,
                                                                         @RequestParam(value = "primaryCategoryId", required = false) Long primaryCategoryId);
}
